--------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\almeida.l
> og
  log type:  text
 opened on:  28 Aug 2016, 22:27:40

. set more off

. #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      almeida_data.do                                 *;
. *       Date:           August 28, 2016                                 *;
. *       Author:         Molly Ariotti and Sona Golder                   *;
. *       Purpose:        Create and label some variables.                *;
. *           Input File:     almeida_cabinets.dta                            *;
. *       Output File:    almeida.log                                     *;
. *       Data Output:    America.dta                                     *;
.              *       Previous file:  almeida_cabinets.xls --> Stata .dta      
>        *;
. *       Machine:        laptop                                                
>           *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Open and summarize dataset. Generate some variables             *;
. *     ****************************************************************  *;
. use "C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\almeida_cabinet
> s.dta";

. sum;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
 countryname |          0
 countrycode |        215    4.967442    2.790816          1         10
 cabinetname |          0
 cabinetcode |        215    35.35349    20.55618          1         74
     cowcode |        215     135.814    20.41858         94        165
-------------+---------------------------------------------------------
        year |        215    1988.856    11.08137       1958       2003
presidential |        215           1           0          1          1
   partyname |          0
   formateur |        215     .344186    .4762109          0          1
portfolios~e |        215    .3442093    .2371627       .056       .929
-------------+---------------------------------------------------------
  portfolios |        215    3.665116    2.968596          1         13
total_part~s |        215    11.16744    3.914968          3         18
   seatshare |        215    .3444047    .2544746          0       .989
 party_seats |        215    38.16744    40.58371          0        260
government~s |        215    123.8558    109.9578          8        398
-------------+---------------------------------------------------------
total_govt~s |        215     15.2093    3.583178          8         23
      region |        215           3           0          3          3

. drop cabinetname total_govt_portfolios;

. rename total_partisan_portfolios government_portfolios;

. encode partyname, generate(party);

. drop partyname;

. gen code = (region*100000) + (countrycode*1000) + cabinetcode ;

. *     ****************************************************************  *;
. *       Label variables                                                 *;
. *     ****************************************************************  *;
. label var countryname "country name";

. label var party_seats "number of legislative seats per party";

. label var party "party number or acronym";

. label var region "1=Africa, 2=Western Europe, 3=Latin America";

. label var cabinetcode "cabinet code";

. label var countrycode "country code";

. label var code "region, country code, cabinet code";

. label var cowcode "cow code";

. label var portfolios "number of portfolios per party";

. label var formateur "1 = formateur, 0 = otherwise";

. label var presidential "1 = presidential, 0 = parliamentary";

.  label var government_portfolios "number of portfolios in the government";

. label var government_seats "number of seats controlled by government";

. label var seatshare "party share of leg seats controlled by govt";

. label var portfolioshare "party share of govt portfolios";

. label var year "year in which government begins";

. sum;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
 countryname |          0
 countrycode |        215    4.967442    2.790816          1         10
 cabinetcode |        215    35.35349    20.55618          1         74
     cowcode |        215     135.814    20.41858         94        165
        year |        215    1988.856    11.08137       1958       2003
-------------+---------------------------------------------------------
presidential |        215           1           0          1          1
   formateur |        215     .344186    .4762109          0          1
portfolios~e |        215    .3442093    .2371627       .056       .929
  portfolios |        215    3.665116    2.968596          1         13
governmen~os |        215    11.16744    3.914968          3         18
-------------+---------------------------------------------------------
   seatshare |        215    .3444047    .2544746          0       .989
 party_seats |        215    38.16744    40.58371          0        260
governmen~ts |        215    123.8558    109.9578          8        398
      region |        215           3           0          3          3
       party |        215    41.33953    22.49841          1         78
-------------+---------------------------------------------------------
        code |        215    305002.8    2811.072     301001     310074

. desc;

Contains data from C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\alm
> eida_cabinets.dta
  obs:           215                          
 vars:            16                          28 Aug 2016 22:26
 size:         8,815                          
--------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
--------------------------------------------------------------------------------
countryname     str10   %10s                  country name
countrycode     byte    %8.0g                 country code
cabinetcode     byte    %8.0g                 cabinet code
cowcode         int     %8.0g                 cow code
year            int     %8.0g                 year in which government begins
presidential    byte    %8.0g                 1 = presidential, 0 =
                                                parliamentary
formateur       byte    %8.0g                 1 = formateur, 0 = otherwise
portfolioshare  float   %8.0g                 party share of govt portfolios
portfolios      byte    %8.0g                 number of portfolios per party
government_po~s byte    %8.0g                 number of portfolios in the
                                                government
seatshare       float   %8.0g                 party share of leg seats
                                                controlled by govt
party_seats     int     %8.0g                 number of legislative seats per
                                                party
government_se~s int     %8.0g                 number of seats controlled by
                                                government
region          byte    %8.0g                 1=Africa, 2=Western Europe,
                                                3=Latin America
party           long    %10.0g     party      party number or acronym
code            float   %9.0g                 region, country code, cabinet code
--------------------------------------------------------------------------------
Sorted by: 
     Note: Dataset has changed since last saved.

. save "C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\America.dta", 
> replace;
file C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\America.dta saved

. log close;
      name:  <unnamed>
       log:  C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\almeida.l
> og
  log type:  text
 closed on:  28 Aug 2016, 22:27:40
--------------------------------------------------------------------------------
